<template>
  <ul class="service-list">
    <li class="service-list-item service-bj1">
      <div v-if="addIcon" style="width: 100%; height: 508px; display: flex; align-items: center; justify-content: center;">
        <svg-icon class="svg-icon-big" icon-class="add" @click="handleAddClick" />
      </div>
      <div v-if="!addIcon">
        <div class="service-title">
          <h3><el-input v-model="content.name" style="width: 90%;" placeholder="产品（项目）名称" /></h3>
        </div>
        <div class="service-content">
          <ul class="service-content-list">
            <li>
              <h4>产品描述</h4>
              <p><el-input v-model="content.remark" class="paperview-input-text" placeholder="添加描述信息" size="mini" /></p>
            </li>
            <li>
              <h4>负责人</h4>
              <p><el-input v-model="content.author" class="paperview-input-text" placeholder="添加负责人" size="mini" /></p>
            </li>
            <li>
              <h4>参与人</h4>
              <p><el-input v-model="content.todo" class="paperview-input-text" placeholder="添加参与人" size="mini" /></p>
            </li>
          </ul>
          <br>
          <br>
          <br>
          <a href="javascript:;" class="service-list-more" @click="handleCreateClick">创建产品（项目）</a>
        </div>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props: {
    submit: {
      type: Function,
      default: () => {}
    }
  },
  data() {
    return {
      addIcon: true,
      formLabelAlign: { name: '', region: '', type: '' },
      content: {}
    }
  },
  methods: {
    handleAddClick() {
      this.addIcon = false
    },
    handleCreateClick() {
      this.submit(this.content)
      this.addIcon = true
    }
  }
}
</script>

<style scoped>
  h3,
  h4,
  p,
  ul,
  li {
    margin: 0;
    padding: 0;
  }

  a {
    text-decoration: none;
    color: #666;
  }

  a:hover {
    color: #eee;
  }

  /* 必要布局样式css */
  .service-list .service-list-item {
    float: left;
    width: 290px;
    margin-right: 13px;
    background: #fff;
    -webkit-transition: all .2s;
    -moz-transition: all .2s;
    transition: all .2s;
    border: 1px solid #E7E9EC;
    overflow: hidden;
  }

  .service-title {
    width: 290px;
    height: 160px;
  }

  .service-bj1 .service-title {
    background: url(../../assets/img/service-001.jpg) no-repeat center top;
  }

  .service-bj2 .service-title {
    background: url(../../assets/img/service-002.jpg) no-repeat center top;
  }

  .service-bj3 .service-title {
    background: url(../../assets/img/service-003.jpg) no-repeat center top;
  }

  .service-bj4 .service-title {
    background: url(../../assets/img/service-004.jpg) no-repeat center top;
  }

  .service-title h3 {
    font-size: 24px;
    text-align: center;
    padding-top: 105px;
    color: #fff;
    font-weight: normal;
  }

  .service-content {
    height: 318px;
    border-top: 0;
  }

  .service-content-list {
    margin-left: 58px;
    margin-top: 28px;
  }

  .service-content-list li {
    margin-bottom: 18px;
    position: relative;
  }

  .service-content-list li:before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #C1C5CB;
    content: "";
    position: absolute;
    left: -16px;
    top: 7px;
  }

  .service-content-list li h4 {
    font-size: 14px;
    color: #616366;
    font-weight: 700;
    margin-bottom: 3px;
    line-height: 20px;
  }

  .service-content-list li p {
    font-size: 14px;
    color: #919499;
  }

  .service-list-more {
    width: 200px;
    height: 40px;
    display: block;
    margin: 0 auto;
    color: #eb6709;
    text-align: center;
    line-height: 40px;
    font-size: 16px;
    border: 1px solid #eb6709;
    transition: all .2s;
  }

  .service-list-more:hover {
    background: #eb6709;
    color: #fff;
  }

  .service-list .service-list-item:hover {
    -webkit-box-shadow: 0 10px 6px -6px #777;
    -moz-box-shadow: 0 10px 6px -6px #777;
    box-shadow: 0 10px 6px -6px #777;
  }

  .svg-icon-big {
    width: 4em;
    height: 4em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
  }

  /* 使用css样式穿透,input框的样式就没了 */
  .paperview-input-text >>> .el-input__inner {
    -webkit-appearance: none;
    background-color: #fff;
    background-image: none;
    border-radius: 4px;
    border: 0px;
    width: 100%;
    height: 16.1px;
  }
</style>
